Ext.define('Admin.view.overtime.OvertimeReapplyForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.overtimeReapplyForm',
    requires: [
    	'Ext.layout.container.Anchor',
    	'Ext.layout.container.Column',
        'Ext.button.Button',
        'Ext.form.field.Text',
        'Ext.form.field.File',
        'Ext.form.field.HtmlEditor',
		'Ext.form.field.TextArea',
		'Ext.form.field.Time',
		'Ext.form.field.ComboBox',
		'Ext.form.field.Date',
		'Ext.form.field.Radio',
		'Ext.form.field.Hidden'
    ],
    //viewModel: {type: 'emailcompose'},
    //cls: 'email-compose',
    controller: 'overtimeViewController',
	
	scrollable:true,
	
    bodyStyle:'padding:5px 5px 0',
    width: "100%",
    fieldDefaults: {
        labelAlign: 'top',
        msgTarget: 'qtip',
        allowBlank:false,
        blankText:'该项不能为空'
    },

    items: [{
        xtype: 'container',
        anchor: '100%',
        layout:'column',
        items:[{
        	xtype:'hidden',
        	name:'id'
        },{
            xtype:'hidden',
            name:'taskId'
        },{
            xtype:'hidden',
            name:'processInstanceId'
        },{
        	xtype:'hidden',
        	name:'userId',
        	value:userId
        },{
            xtype:'hidden',
            name:'taskDefinitionKey'
        },{
            xtype: 'container',
            columnWidth:.5,
            layout: 'anchor',
            items: [{
            	id:'name',
                xtype:'textfield',
                fieldLabel: '申请人',
                name: 'name',
                anchor:'96%'
            },{
            xtype: 'combobox',
            fieldLabel: '所属部门',
            name: 'department',
            editable:false,
            anchor:'96%',
            displayField: 'name',
            valueField: 'id',
            allowBlank: false,
            store: Ext.create('store.organizationStore')
        }]
        },{
            xtype: 'container',
            columnWidth:.5,
            layout: 'anchor',
            items: [{
                xtype:'datefield',
                fieldLabel: '加班日期',
                name: 'overtimeDate',
                format:'Y/m/d',
                anchor:'100%'
            },{
            	id:'begin',
                xtype:'timefield',
                fieldLabel: '开始时间',
                name: 'beginTime',
                format: 'H:i',
                increment: 30,
                anchor:'100%',
                value:'0:00',
                listeners:{
			        blur: function(){
			            var end=Ext.getCmp('end');
			            end.setMinValue(this.value);
			        } 
			    }
            },{
            	id:'end',
                xtype:'timefield',
                fieldLabel: '结束时间',
                increment: 30,
                format: 'H:i',
                maxValue:'24:00',
                name: 'endTime',
                anchor:'100%'
            }]
        }]
    }, {
        xtype: 'textarea',
        name: 'reason',
        fieldLabel: '加班理由',
        allowBlank:false,
        anchor: '100%'
    },{
        xtype: 'textarea',
        name: 'rejectReason',
        fieldLabel: '驳回理由',
        readOnly:true,
        allowBlank:false,
        anchor: '100%'
    }],
    bbar: {
        items: ['->',{
			xtype: 'button',
			//ui: 'soft-red',
			text: '重新申请',
			handler: 'OvertimeReapply'
		},{
            xtype: 'button',
            //ui: 'soft-red',
            text: '取消申请',
            handler: 'OvertimeReapplyCancel'
        },{
			xtype: 'button',
			//ui: 'gray',
			text: '取消',
			handler: 'OvertimeGridWindowClose'
		}]
    }
});